home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / LabelP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  4.9 KB  |  150 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: LabelP.h,v $ $Revision: 1.19 $ $Date: 92/05/14 12:52:50 $ */
  6. /*
  7. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  8. /*
  9. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  10. #ifndef _XmLabelP_h
  11. #define _XmLabelP_h
  12.  
  13. #include <Xm/Label.h>
  14. #include <Xm/PrimitiveP.h>
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. /*  The Label Widget Class and instance records  */
  21.  
  22. typedef struct _XmLabelClassPart     /* label class record */
  23. {
  24.         XtWidgetProc    setOverrideCallback;
  25.     XmMenuProc    menuProcs;
  26.         String  /* XtTranslations */  translations;
  27.         XtPointer        extension; /* Pointer to extension record */
  28. } XmLabelClassPart;
  29.  
  30. typedef struct _XmLabelClassRec
  31. {
  32.     CoreClassPart        core_class;
  33.     XmPrimitiveClassPart primitive_class;
  34.     XmLabelClassPart     label_class;
  35. } XmLabelClassRec;
  36.  
  37. extern XmLabelClassRec xmLabelClassRec;
  38.  
  39.  
  40. /* Inherited  Functions exported by label */
  41.  
  42. #define XmInheritSetOverrideCallback ((XtWidgetProc) _XtInherit)
  43. #define XmInheritResize  ((XtWidgetProc) _XtInherit)
  44. #define XmInheritRealize  ((XtRealizeProc) _XtInherit)
  45.  
  46. /* The padding between label text and accelerator text */
  47.  
  48. # define LABEL_ACC_PAD         15
  49.  
  50. /*  The Label instance record  */
  51.  
  52. typedef struct _XmLabelPart
  53. {
  54.     _XmString    _label;  /* String sent to this widget */
  55.         _XmString    _acc_text;
  56.      KeySym        mnemonic;
  57. /**        char            mnemonic;    **/
  58.         XmStringCharSet mnemonicCharset;
  59.         char         *accelerator;
  60.         unsigned char    label_type;
  61.         unsigned char    alignment;
  62.         unsigned char    string_direction;
  63.         XmFontList    font;
  64.     
  65.     Dimension    margin_height;   /* margin around widget */
  66.         Dimension    margin_width;
  67.  
  68.     Dimension     margin_left;    /* additional margins on */
  69.         Dimension    margin_right;   /* each side of widget */
  70.         Dimension    margin_top;     /* text (or pixmap) is placed */
  71.         Dimension    margin_bottom;  /* inside the margins */
  72.  
  73.         Boolean     recompute_size;
  74.  
  75.         Pixmap        pixmap; 
  76.         Pixmap        pixmap_insen; 
  77.  
  78.         /* PRIVATE members -- values computed by LabelWidgetClass methods */
  79.  
  80.         GC        normal_GC;   /* GC for text */    
  81.         GC        insensitive_GC;
  82.         XRectangle    TextRect;    /* The bounding box of the text, or clip
  83.                                         rectangle of the window; whichever is
  84.                                         smaller */
  85.         XRectangle    acc_TextRect; /* The bounding box of the text, or clip
  86.                                         rectangle of the window; whichever is
  87.                                         smaller */
  88.  
  89.     Boolean        skipCallback; /* set by RowColumn when entryCallback
  90.                     is provided. */
  91.     unsigned char   menu_type;
  92.  
  93. } XmLabelPart;
  94.  
  95.  
  96. typedef struct _XmLabelRec
  97. {
  98.    CorePart         core;
  99.    XmPrimitivePart  primitive;
  100.    XmLabelPart        label;
  101. } XmLabelRec;
  102.  
  103. /* MACROS */
  104.  
  105. #define Lab_MarginWidth(w)        (((XmLabelWidget)(w)) ->label.margin_width)
  106. #define Lab_MarginHeight(w)        (((XmLabelWidget)(w)) ->label.margin_height)
  107. #define Lab_MarginTop(w)        (((XmLabelWidget)(w)) ->label.margin_top)
  108. #define Lab_MarginBottom(w)        (((XmLabelWidget)(w)) ->label.margin_bottom)
  109. #define Lab_MarginRight(w)        (((XmLabelWidget)(w)) ->label.margin_right)
  110. #define Lab_MarginLeft(w)        (((XmLabelWidget)(w)) ->label.margin_left)
  111. #define Lab_TextRect_x(w)        (((XmLabelWidget)(w)) ->label.TextRect.x)
  112. #define Lab_TextRect_y(w)        (((XmLabelWidget)(w)) ->label.TextRect.y)
  113. #define Lab_TextRect_width(w)        (((XmLabelWidget)(w)) ->label.TextRect.width)
  114. #define Lab_TextRect_height(w)        (((XmLabelWidget)(w)) ->label.TextRect.height)
  115.  
  116. #define Lab_IsText(w)            (((XmLabelWidget)(w)) ->label.label_type == XmSTRING)
  117. #define Lab_IsPixmap(w)            (((XmLabelWidget)(w)) ->label.label_type == XmPIXMAP)
  118.  
  119. #define Lab_Font(w)            (((XmLabelWidget)(w)) ->label.font)
  120.  
  121. #define Lab_Mnemonic(w)            (((XmLabelWidget)(w)) ->label.mnemonic)
  122. #define Lab_Accelerator(w)        (((XmLabelWidget)(w)) ->label.accelerator)
  123. #define Lab_AcceleratorText(w)        (((XmLabelWidget)(w)) ->label.acc_text)
  124. #define Lab_MenuType(w)            (((XmLabelWidget)(w))->label.menu_type)
  125. #define Lab_Shadow(w)                   (((XmLabelWidget)(w))->primitive.shadow_thickness)
  126. #define Lab_Highlight(w)                (((XmLabelWidget)(w))->primitive.highlight_thickness)
  127. #define Lab_Baseline(w)                 (_XmStringBaseline ( \
  128.                                          ((XmLabelWidget)(w))->label.font,\
  129.                                          ((XmLabelWidget)(w))->label._label))
  130. /********    Private Function Declarations    ********/
  131. #ifdef _NO_PROTO
  132.  
  133. extern void _XmCalcLabelDimensions() ;
  134.  
  135. #else
  136.  
  137. extern void _XmCalcLabelDimensions( 
  138.                         Widget wid) ;
  139.  
  140. #endif /* _NO_PROTO */
  141. /********    End Private Function Declarations    ********/
  142.  
  143.  
  144. #ifdef __cplusplus
  145. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  146. #endif
  147.  
  148. #endif /* _XmLabelP_h */
  149. /* DON'T ADD ANYTHING AFTER THIS #endif */
  150.